//
//  XRGridTableView.h
//  XRmenu
//
//  Created by loufq on 11-11-23.
//  Copyright 2011年 foxhis. All rights reserved.
//

#import "XRmenuBaseView.h"
#import "DishAlbumNavView.h"
#import "XRGridTableCell.h"


@protocol XRGridTableViewDataSource;
@protocol XRGridTableViewDelegate;

@interface XRGridTableView : XRmenuBaseView <DishAlbumNavViewDelegate,XRGridTableCell>{

@private
	NSInteger rows;//显示行数
	NSInteger columns;//显示列数
	NSInteger currentPageIndex;//当前页
	NSInteger pageCount;//总页数
	id<XRGridTableViewDataSource> datasource;
	id<XRGridTableViewDelegate> delegate; 
	CGSize cellSize;
	CGSize cellMargin; 
	DishAlbumNavView* mNavView;  
}
@property (nonatomic, assign) NSInteger rows;
@property (nonatomic, assign) NSInteger columns;
@property (nonatomic, assign) NSInteger currentPageIndex;
@property (nonatomic, assign) NSInteger pageCount;
@property (nonatomic, assign) id<XRGridTableViewDataSource> datasource;
@property (nonatomic, assign) id<XRGridTableViewDelegate> delegate;
@property (nonatomic, retain) DishAlbumNavView *mNavView;


-(void)reloadData;
-(id)initWithTarget:(id)aTarget position:(CGPoint)aPosition;

@end


@protocol XRGridTableViewDataSource
//框大小
-(NSInteger) multiColTableViewShowRows;//行数
-(NSInteger) multiColTableViewShowColums;//列数
-(NSInteger) multiColTableViewDisplayCount;//总记录数
-(XRGridTableCell*)   multiColTableView:(XRGridTableView *)aTableView viewAtPosition:(NSInteger)aPosition;
@optional
-(CGSize) cellSize;
-(CGSize) cellMargin;
@end

@protocol XRGridTableViewDelegate
-(void) multiColTableView:(XRGridTableView *)aTableView didTappedAtPosition:(NSInteger)aPosition withCell:(XRGridTableCell*)aCell;
@end

